{{include template('public/header','admin')}}
<link href="{{STATIC_URL}}/plugins/calendar/calendar.css" rel="stylesheet" type="text/css"/>
<script src="{{STATIC_URL}}/plugins/calendar/calendar.js" type="text/javascript"></script>
<body>
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <div class="search">
                    <div class="well">
                        <form class="form-inline" action="{{url()}}" method="get">
                            <div class="form-group">
                                <label>{{L('order_addtime')}}</label>
                                <input type="text" name="startdate" class="calendar-icon form-control" value="" style="width:110px;" onclick="showcalendar(event, this)"   />
                                <input type="text" name="enddate" class="calendar-icon form-control" value="" style="width:110px;" onclick="showcalendar(event, this, false)"  />
                            </div>
                            <div class="form-group">
                                <label for="status">{{L('order_status')}}</label>
                                <select id="search[status]" name="search[status]" class="form-control">
                                    <option  value="99">全部</option>
                                    <option  value="0">未付款</option>
                                    <option  value="1">已付款</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label>关键字</label>
                                <select id="search[status]" name="search[status]" class="form-control">
                                    <option  value="order_sn">{{L('order_order_sn')}}</option>
                                    <option  value="userid">{{L('order_userid')}}</option>
                                </select>
                                <input type="text" name="search[key]" class="form-control" placeholder="支持模糊查询" value="{{$search.title}}">
                            </div>

                            <button type="submit" class="btn btn-primary"><i class="fa fa-search" aria-hidden="true"></i>{{L('search')}}</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <form method="post" action="/admin/order/batchremove" class="form-inline" role="form">
                    <table id='OrderList' class="table table-condensed table-hover table-striped tablesorter table-fixed table-selectable">
                        <thead>
                            <tr>
                                <th style="width: 15px;">

                                </th>
                                <th>{{L('order_id')}}</th>
                                <th>{{L('order_username')}}</th>
                                <th>{{L('order_order_sn')}}</th>
                                <th>{{L('order_money')}}</th>
                                <th>{{L('order_addtime')}}</th>
                                <th>{{L('order_paytime')}}</th>
                                <th>{{L('order_status')}}</th>
                                <th>{{L('order_paytype')}}</th>
                                <th>{{L('edit')}}</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{foreach $items as $item}}
                            <tr>
                                <td><input type="checkbox" class="checkbox" name="ids[]" value="{{$item.id}}" /></td>
                                <td >{{$item.id}}</td>
                                <td >{{$item.username}}({{$item.userid}})</td>
                                <td >{{$item.order_sn}}</td>
                                <td >{{$item.money}}</td>
                                <td>{{date("Y-m-d H:i:s",$item.addtime)}}</td>
                                <td>{{$item.paytime}}</td>
                                <td>{{$item.status}}</td>
                                <td>{{$item.paytype}}</td>
                                <td style="width: 15%">
                                    {{if $item.status eq 0}}
                                    <a href="javascript:;" onclick="layer_open('订单改价', '/admin/order/change_price/?id={{$item.id}}', 550, 350)" class="btn btn-warning btn-xs" style="text-decoration:none">改价</a>
                                    {{else}}
                                    <a href="javascript:;" onclick="layer_open('订单详情', '/admin/order/details/?id={{$item.id}}', 550, 350)" class="btn btn-primary btn-xs" style="text-decoration:none">详情</a>
                                    {{/if}}
                                    <a href="javascript:;" onclick="layer_del('/admin/order/delete/?id={{$item.id}}')"  class="btn btn-danger btn-xs" style="text-decoration:none">删除</a>
                                </td>
                            </tr>
                            {{/foreach}}
                        </tbody>
                        <tr>
                            <td colspan="15">
                                <div style="text-align: left;">
                                    <input type="checkbox" name="chkall" id="chkall" class="checkbox" onclick="checkAll('prefix', this.form, 'ids')" />{{L('chkall')}}
                                    <input type="radio" class="radio" id="optype_outer" name="optype" value="del" />{{L('delete')}}
                                    <input type="submit" class="btn" name="sendsubmit" value="{{L('submit')}}" />
                                    {{include template('public/page','admin')}}
                                </div>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
</body>
</html>